#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * DNS Mail Information Structure
 *      Represents a DNS mail information (MINFO) record.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
using namespace System;
using namespace System::Net;

namespace Adaptive
{
	namespace Network
	{
		namespace Dns
		{
			/// <summary>
			/// Represents a DNS mail information (MINFO) record.
			/// </summary>
			public value struct DnsMailInformationRecord
			{
			internal:
				/// <summary>
				/// Initializes a new instance of the class from the unmanaged record.
				/// </summary>
				/// <param name="record"> A pointer to a DNS_RECORD structure whose contents are to be copied.</param>
				DnsMailInformationRecord(DNS_RECORD* record)
				{
					if (record == NULL)
					{
						MailboxName = String::Empty;
						ErrorsMailboxName = String::Empty;
					}
					else
					{
						MailboxName = gcnew String ( record->Data.MINFO.pNameMailbox );
						ErrorsMailboxName = gcnew String ( record->Data.MINFO.pNameErrorsMailbox );
					}
				}
				private:
				/// <summary>
				/// Static constructor.
				/// </summary>
				static DnsMailInformationRecord()
				{
				}
			public:

				/// <summary>
				/// A string representing the fully qualified domain name (FQDN) of the mailbox responsible for the mailing 
				/// list or mailbox specified in the record's owner name.
				/// </summary>
				/// <value>
				/// A mail server domain name or an empty string.
				/// </value>
				String^		MailboxName;
				/// <summary>
				/// A string representing the fully qualified domain name (FQDN) of the mailbox to receive error messages 
				/// related to the mailing list.
				/// </summary>
				/// <value>
				/// A mail server domain name or an empty string.
				/// </value>
				String^		ErrorsMailboxName;
			};
		}
	}
}
